
*Table 1 
xtset, clear //don't xtset if you use bootstrapping
M1 continuous DV -> OLS with FEs (reghdfe) 
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
M2 continuous DV -> OLS with FEs (reghdfe) (DV already contains ratio on days, but M2 also adds it as control)
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
M3 countable DV -> count_model like poisson_or ppmlhdfe, with FE, confirms results
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: ppmlhdfe Count_VisitPMOut c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1,  a(COW) vce(cluster Government COW) d


*Figure 2
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
margins, at(CHES =(2.5(0.5)8.5))  atmeans vsquish 
marginsplot, plot1opts(m(square) lp(solid) lcolor(black) mcolor(black)) ci1opts(lcolor(black) lwidth(thin) lp(solid)) scheme(cleanplots) xtitle("Government ideology (left-right axis)") ytitle("Predicted number of PM outgoing visits" "per average partner, every 100 days") xsize(6.5) ysize(3.5) title("") note("Adjusted predictions with 95% CIs", size(vsmall)) graphregion(margin(l=10 r=15 b=5 t=10))
graph export MarginsM2curvilinear.png, height(900)

*Figure 3
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
margins, at(CHES =(2.6 3.6 4.0 5.6 6.2 7.1 7.4 8.1)  Democracy =(0 1))  atmeans vsquish 
mplotoffset, legend(order(1 "Autocratic regimes" 2 "Democratic regimes") position(6)) legend(rows(1)) plot1opts(m(square) lp(solid) lcolor(black) mcolor(black)) plot2opts(m(Sh) lp(shortdash) lcolor(black) mcolor(black)) ci1opts(lcolor(black) lwidth(thin) lp(solid)) ci2opts(lcolor(black) lwidth(vthin) lp(shortdash)) level(95) scheme(cleanplots) xtitle("Government ideology (left-right axis)") ytitle("Predicted number of PM outgoing visits" "per average partner, every 100 days") xsize(6.5) ysize(3.5) xlabel(2.6 "PRO_II" 3.6 "AMA" 4.0 "LET, REN, GEN, CON_II" 5.6 "MON, DRA" 6.2 "CON_I" 7.1 "BER_II, III" 7.4 "BER_IV" 8.1 "MEL", labsize(tiny)) recast(scatter) title("") note("Adjusted predictions with 95% CIs", size(vsmall)) graphregion(margin(l=10 r=15 b=5 t=10))
graph export MarginsM2.png, height(900) 


*Appendix
*Table A1-A2-A3 alternative democracy variables confirm results
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy_softer##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy_row##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 

*Table A4-A5 including MFA data
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMFMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMFMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
margins, at(CHES =(2.6 3.6 4.0 5.6 6.2 7.1 7.4 8.1)  Democracy =(0 1))  atmeans vsquish 
mplotoffset, legend(order(1 "Autocratic regimes" 2 "Democratic regimes") position(6)) legend(rows(1)) plot1opts(m(square) lp(solid) lcolor(black) mcolor(black)) plot2opts(m(Sh) lp(shortdash) lcolor(black) mcolor(black)) ci1opts(lcolor(black) lwidth(thin) lp(solid)) ci2opts(lcolor(black) lwidth(vthin) lp(shortdash)) level(95) scheme(cleanplots) xtitle("Government ideology (left-right axis)") ytitle("Predicted number of PM outgoing visits" "per average partner, every 100 days") xsize(6.5) ysize(3.5) xlabel(2.6 "PRO_II" 3.6 "AMA" 4.0 "LET, REN, GEN, CON_II" 5.6 "MON, DRA" 6.2 "CON_I" 7.1 "BER_II, III" 7.4 "BER_IV" 8.1 "MEL", labsize(tiny)) recast(scatter) title("") note("Adjusted predictions with 95% CIs", size(vsmall)) graphregion(margin(l=10 r=15 b=5 t=10))
graph export FigureA4.png, height(900)
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: ppmlhdfe Count_VisitPMFMOut c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMFMInc WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1,  a(COW) vce(cluster Government COW) d

*Table A6-A7 GAL-TAN
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.Galtan##c.Galtan i.Democracy##c.Galtan Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
margins, at(Galtan =(2.5 3.0 3.7 5.7 6.2 6.9 7.3 8.8)  Democracy =(0 1))  atmeans vsquish 
mplotoffset, legend(order(1 "Autocratic regimes" 2 "Democratic regimes") position(6)) legend(rows(1)) plot1opts(m(square) lp(solid) lcolor(black) mcolor(black)) plot2opts(m(Sh) lp(shortdash) lcolor(black) mcolor(black)) ci1opts(lcolor(black) lwidth(thin) lp(solid)) ci2opts(lcolor(black) lwidth(vthin) lp(shortdash)) level(95) scheme(cleanplots) xtitle("Government ideology (GAL-TAN axis)") ytitle("Predicted number of PM outgoing visits" "per average partner, every 100 days") xsize(6.5) ysize(3.5) xlabel(2.5 "PRO_II" 3.0 "LET, REN, GEN, CON_II, DRA" 3.7 "AMA" 5.7 "CON_I" 6.2 "MON" 6.9 "BER_III" 7.3 "BER_II, IV" 8.8 "MEL", labsize(tiny)) recast(scatter) title("") note("Adjusted predictions with 95% CIs", size(vsmall)) graphregion(margin(l=10 r=15 b=5 t=10))
graph export FigureA6.png, height(900)
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: ppmlhdfe Count_VisitPMOut c.Galtan##c.Galtan i.Democracy##c.Galtan Count_VisitPMInc WorldDemShare WorldGDPgrowth Duration if SamplePMBoth==1,  a(COW) vce(cluster Government COW) d

*Table A8-A9 additional controls on military expenditures and migrant communities
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth MilitaryExports Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 
bootstrap _b, cluster(Government COW) reps(200) seed(1) nodots: reghdfe Count_VisitPMOut_rate100 c.CHES##c.CHES i.Democracy##c.CHES Count_VisitPMInc_rate100 WorldDemShare WorldGDPgrowth MigrantCommunities Duration if SamplePMBoth==1, abs(COW) vce(cluster Government COW) 

